#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
# 
#      http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
#
# $Id: Makefile.in 568078 2007-08-21 11:43:25Z amassari $
#

###################################################################
#                    IMPORTANT NOTE                               #
###################################################################
# If you are going to do the OS390BATCH build, make sure you have #
# the OS390BATCH environment variable set.                        #
#                                                                 #
#   export OS390BATCH=1                                           #
#                                                                 #
###################################################################

PLATFORM = LINUX
COMPILER = g++
CXXVER = 
GCC = yes
GXX = yes
CXXFLAGS = -g -O2
CFLAGS = -g -O2
LDFLAGS = 
THREADS = 
EXTRA_LIBS = 
PREFIX = /usr/local

include ${XERCESCROOT}/version.incl
include ../Makefile.incl

APP_NAME=SAX2Print

OUTDIR= ${XERCESCOUT}/bin/obj/${APP_NAME}
EXEC=	${XERCESCOUT}/bin
OBJS=	${OUTDIR}/SAX2Print.o ${OUTDIR}/SAX2PrintHandlers.o ${OUTDIR}/SAX2FilterHandlers.o
SRC=	${XERCESCOUT}/samples/${APP_NAME}
HEADER_FILES=${SRC}/SAX2Print.hpp ${SRC}/SAX2PrintHandlers.hpp ${SRC}/SAX2FilterHandlers.hpp

## OS390BATCH
ifeq (${OS390BATCH},1)
BATCH_TARGET= "//'${LOADMOD}(SAX2PRNT)'"
all:: makedir ${BATCH_TARGET}
else
all:: makedir ${EXEC}/${APP_NAME}
endif

makedir::
	-mkdir -p $(OUTDIR)

${EXEC}/${APP_NAME}:: ${OBJS}
	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS}
${BATCH_TARGET}:: ${OBJS}
	${LINK} ${PLATFORM_LIB_LINK_OPTIONS} ${OBJS} -o $@ ${LIBRARY_SEARCH_PATHS} ${LIBRARY_NAMES} ${EXTRA_LINK_OPTIONS}

$(OUTDIR)/SAX2Print.o:: ${SRC}/SAX2Print.cpp ${HEADER_FILES}
	${CC} ${INCLUDES} ${CMP} -o $(OUTDIR)/SAX2Print.o ${SRC}/SAX2Print.cpp

$(OUTDIR)/SAX2PrintHandlers.o:: ${SRC}/SAX2PrintHandlers.cpp ${HEADER_FILES}
	${CC} ${INCLUDES} ${CMP} -o $(OUTDIR)/SAX2PrintHandlers.o ${SRC}/SAX2PrintHandlers.cpp

$(OUTDIR)/SAX2FilterHandlers.o:: ${SRC}/SAX2FilterHandlers.cpp ${HEADER_FILES}
	${CC} ${INCLUDES} ${CMP} -o $(OUTDIR)/SAX2FilterHandlers.o ${SRC}/SAX2FilterHandlers.cpp

clean::
	rm -f ${OBJS} ${EXEC}/${APP_NAME}

distclean::	clean
	rm -f Makefile
